#编译镜像
FROM golang:1.18.3-alpine3.16  as builder
WORKDIR /go/src
COPY . .
RUN go build -o app

#产物运行镜像
FROM  alpine:latest
WORKDIR  /root
COPY  --from=builder /go/src/app .
CMD  ["./app"]